package com.ys.everydaynews.ui.main.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import com.ys.everydaynews.R
import com.ys.everydaynews.databinding.ItemMinlistBinding
import com.ys.everydaynews.ui.main.model.CodeModel

class MinListAdapter(minList: MutableList<CodeModel>) :
    RecyclerView.Adapter<MinListAdapter.MinListHolder>() {
    private val minList: MutableList<CodeModel> = minList

//    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MinListHolder =
//        MinListHolder(
//            LayoutInflater.from(parent.context).inflate(
//                R.layout.item_minlist, parent
//            )
//        )

    override fun onBindViewHolder(holder: MinListHolder, position: Int) {

    }

    override fun getItemCount(): Int = minList.size

    class MinListHolder(it: View) : RecyclerView.ViewHolder(it)

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MinListHolder {
        val binding: ItemMinlistBinding = DataBindingUtil.inflate(
            LayoutInflater.from(parent.context),
            R.layout.item_minlist,
            parent,
            false
        )

        return MinListHolder(binding.getRoot())
    }
}